package com.sunlong.jiangwei.dao;

import com.sunlong.jiangwei.entity.JwStore;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 孙龙
 * @since 2021-02-19
 */
public interface JwStoreMapper extends Mapper<JwStore>,MySqlMapper<JwStore> {

    /**
     * 根据id修改头像图片地址
     * @param imageUrl
     * @param id
     */
    @Update("update jw_store set store_image = #{imageUrl} where store_id = #{id}")
    public void updateImageByStoreId(String imageUrl,Long id);

    /**
     * 根据id修改名称
     * @param name
     * @param id
     */
    @Update("update jw_store set store_name = #{name} where store_id = #{id}")
    void updateNameById(String name, Long id);

    @Select("select * from jw_store where store_id = #{storeId}")
    JwStore selectByStoreId(Long storeId);
}
